<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html>
	<head>
	    <base href="<%=basePath%>">
		<title>会员导入</title>
		<link rel="stylesheet" href="css/radius.css" type="text/css"></link>
		<link rel="stylesheet" href="css/Inputstyle.css" type="text/css"></link>
        <%@include file="../collect/meta.jsp"%>
  </head>
	<body lang="zh-cn">
	<div class="wrapper">	
       <c:import url="/collect/top.jsp"></c:import>
		<div class="main-container" id="main-container">
			<div class="main-container-inner">
				<c:import url="/collect/left.jsp"></c:import>
				<div class="main-content">
					<div class="breadcrumbs" id="breadcrumbs">
						<ul class="breadcrumb">
							<li><i class="icon-home home-icon"></i>会员管理</li>
							<li>会员导入</li>
						</ul><!-- .breadcrumb -->
					</div>
					<div class="page-content">
						<div class="row">
							<div class="col-xs-12">
								<!-- PAGE CONTENT BEGINS -->  
					           <div class="alert alert-success">
		        		         <b>操作步骤：</b>
		                         <p>1.从指定链接下载模板文件到本地电脑；</p>
		                         <p>2.用微软Execl软件打开下载的文件，然后添加相关数据，记住，不要做其他任何格式上的更改工作！！！</p>
		                         <p>3.编辑完成后，保存文件。</p>
		                         <p>4.上传文件到服务器，完成导入工作。导入成功后，页面会有“数据导入成功”的提示。</p>
		        	           </div>	
		        	           <div align="center" style="font-size:20px;">
						         <span style="color: red;"><b>点这里</b></span>
						         <a href="http://pan.baidu.com/s/1c0b7bxu" target='_blank'><b>下载模板</b></a>
						       </div>
		        	           <div align="center">							
				                 <div class="appmsg_edit_item" style="margin:20px;width:300px">
					              <div class="oinput">
						            <form action="datebaseimport!readCSVFileAndImport" name="readCSVFile" method="post" enctype="multipart/form-data">
						          	    <input type="file" class="form-control" id="fileid"  name="upload" />
						          	    <input type="button" class="btn btn-primary btn-sm radius" id="subBtn" value="上传数据"/>
						          	    <br>
				                        <b id="backMessage"  style="font-size:20px;color:red;">${result }</b>
				                   </form>    
					              </div>
				                </div>
				                </div>
				                <c:if test="${not empty repeatMember}">
				                <div align="center" style="font-weight:bold;margin-bottom:20px;font-size:18px;color:red">您csv文件中有重复的数据，请确认！</div>
				                <table class="table table-striped table-bordered table-hover">
				                	<tr>
				                	   <th colspan="3"><div align="center">手机号 </div></th>
				                	</tr>
				                	<c:forEach items="${repeatMember }" var="memMoble" varStatus="status">
				                	  <c:if test="${status.count%3==1}"><tr></c:if>
				                		<td align="center">${memMoble }</td>
				                	</c:forEach>
				                </table>
				                </c:if>
		                       <!-- PAGE CONTENT ENDS -->
						   </div><!-- /.col -->
						</div><!-- /.row -->
					</div><!-- /.page-content -->
				</div><!-- /.main-content -->
			</div><!-- /.main-container-inner -->
			<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse" style="position:fixed;bottom:0;">
				<i class="icon-double-angle-up icon-only bigger-110"></i>
			</a>
		</div><!-- /.main-container -->
		<div class="push"></div>
     </div>
     <c:import url="/collect/down.jsp"></c:import>   
  </body>
  <script type="text/javascript" src="${ctx}/js/returnTop.js"></script>
  <script type="text/javascript">
		$(document).ready(function(){
			$("#subBtn").click(function(){
			    var upfile = $("#fileid").val();
			    if (upfile == "" || upfile == null) {
			       alert("请选择CSV文件！");
			       return false;
		        }
				if (!confirm("确认上传？")) {
					return false;
				}
				readCSVFile.submit();
			});
		});

        $(function(){
		    $('#fileid').ace_file_input({
			    no_file:'选择CSV文件...',
			    btn_choose:'选择',
			    btn_change:'重选',
			    no_icon:'icon-upload-alt',
			    icon_remove:'',
			    droppable:false,
			    onchange:null,
			    remove:false,
			    thumbnail:false //| true | large
		   });
	    });
	    
	    //防收回；导入csv：$会员导入
		$('.membership > ul').show();
		$('.membership > ul > li > a').eq(1).css("color","red");        
   </script>
</html>